<template>
	<div>
        <div style="height:1rem;"></div>
		<div class="aui-row top_div order_class">
            <!-- style="background-color:#fff;padding-top:1rem;float:left;width:33.33%;padding-bottom:1rem;position:relative;" -->
			<div id="call_server" class="aui-col-xs-4"  @click="$router.push('callserver')">
				<i class="icon njfont nj-dianhua"></i>
				<div class="aui-grid-label">电话客服</div>
				<div class="right_line"></div>
			</div>
			<div id="feedback" class="aui-col-xs-4" @click="$router.push('feedback')">
				<i class="icon njfont nj-bianji"></i>
				<div class="aui-grid-label">意见反馈</div>
				<div class="right_line"></div>
			</div>
			<div id="onli" class="aui-col-xs-4" @click="goAfterSale">
				<i class="icon njfont nj-daipingjia"></i>
				<div class="aui-grid-label">售后服务</div>
			</div>
            <div style="clear:both;"></div>
		</div>
	</div>
</template>

<script>
    import {mapMutations, mapActions, mapGetters} from "vuex";
    import { NAVIGATE } from '../../../config/postMessage-types';
	 export default {
        props: {
         	turn : {
         		type:Function,
         		default:() => {console.log(1)},
         	}
        },
        data () {
            return {
                
            }
        },
        computed: {
            ...mapGetters('wxh', [
                'userInfo'
            ]),
            hasUserInfo() {
                return Object.keys(this.userInfo).length;
            },
        },
        watch: {
            hasUserInfo(newVal,oldVal) {
                
            },
        },
        methods: {
            isLogin(){
                return window.localStorage.getItem('sessionId');
            },
            toLogin(){
                let goBackIns = {
                    type: NAVIGATE,
                    params: {
                        screen: 'Login',
                        params:{
                            FromWeb: true
                        }
                    }
                }
                window.postMessage(JSON.stringify(goBackIns));
            },
            goAfterSale() {
                if(this.isLogin()){
                    let goBackIns = {
                        type: NAVIGATE,
                        params: {
                            screen: 'AfterSaleList'
                        }  
                    }
                    window.postMessage(JSON.stringify(goBackIns));
                }else{
                    this.toLogin();
                }
                
            }
        },
        created(){
        //   this.$store.dispatch('cjy/getOrderCount')
        	// console.log(this.turn)
        }
    }
</script>

<style scoped="scoped">
    .right_line {
        border-right: 1px solid #eaeaea;
        height: 1.6rem;
        position: absolute;
        top: 1.2rem;
        right: 0;
    }
</style>
